
<ul id="organisation" class="hide">
    <li title='<center>BINTANG<BR>081294943536<BR>BREBES JAWA TENGAH</center>' class='small'>
        <br>CBR<br>7777777
        <ul id='ul-matrix' class='hide'>
            <li title='<center>CBR<BR>081390008033<BR>BREBES JATENG</center>' data-actor='181' class='small' >
            <br>CBR<br>3988115
            <li title='<center>CBR<BR>089639181414<BR>BREBES JAWA TENGAH</center>' data-actor='182' class='small' >
            <br>CBR<br>8068473
            <li title='<center>CBR<BR>081215462999<BR>BREBES JATENG</center>' data-actor='185' class='small' >
            <br>CBR<br>5305114
            <li title='<center>CBR<BR>085747832999<BR>BREBES JATENG</center>' data-actor='186' class='small' >
            <br>CBR<br>9578016
            <li title='<center>CBR<BR>081294943536<BR>BREBES BREBES</center>' data-actor='190' class='small' >
            <br>CBR<br>4186744
            
        </ul>

    </li>
</ul>

<div id="main"></div>

<script>

<?php
if ($this->sponsorId > 0) {
?>
$(function() {
    $("#organisation_sponsor").orgChart({
        container: $("#main_sponsor")
        ,stack      : true
    });

});
<?php } ?>

$(function() {
    $("#organisation").orgChart({
        container: $("#main")
        ,stack      : true
        //,interactive: true
        ,nodeClicked: onChartNodeClicked
    });

    $(function(){
        $("[title]").tipTip();
    });


});




function onChartNodeClicked($node) {
    //alert($node.data("actor"));
    if ($node.data("actor") != undefined){
        //location.href = $node.data("actor");

        getChild($node.data("actor"));

    }
}


function getChild(data) {

    $.ajax({
        url: '/member/network/',
        type: "post",
        data: {key : data, ajax: 1},
        success: function(response, opts){

            var cekSess = response.toUpperCase().search("SESSION TIMEOUT");

            if (cekSess < 0){
                $("#div_content").html(response);
            }else{
                location.href='/index/login/Session Timeout silahkan login kembali !';
            }

        },
        error:function(response, opts){
            //alert("failure");
            $("#div_content").html(response);

        }
    });

};

function getTreeChild(data) {

    $.ajax({
        url: '/member/treenary/',
        type: "post",
        data: {key : data, ajax: 1},
        success: function(response, opts){

            var cekSess = response.toUpperCase().search("SESSION TIMEOUT");

            if (cekSess < 0){
                $("#div_content").html(response);
            }else{
                location.href='/index/login/Session Timeout silahkan login kembali !';
            }

        },
        error:function(response, opts){
            //alert("failure");
            $("#div_content").html(response);

        }
    });

};


<?php
if ($this->parent == 1){
    ?>
        document.getElementById('upline').innerHTML = document.getElementById('uplineContent').innerHTML;
<?php
}
?>
</script>